<!-- TODO 查看与编辑 班级信息 早教-->
<script id="edit-classes-template-ee" type="text/x-handlebars-template">
	<form class="form-horizontal form-editor form-editor-classes">
		<input type="hidden" name="id" value="{{id}}">
		<div class="row">
			<div class="col-sm-4">
				<div class="form-group">
					<label class="col-sm-4 control-label" for="lesson">课程选择</label>
					<div class="col-sm-8">
						<select name="relations[0].targetid" id="lesson" class="chosen-select"
							data-entity="com.app.miwawa.api.eam.entity.Lesson">
							{{lesson lesson '#lesson'}}
						</select>
						<input name="relations[0].target" type="hidden" value="lesson">
						<input name="relations[0].status" type="hidden" value="0">
						<input name="relations[0].invalid" type="hidden" value="F">
						<input name="relations[0].classesid" type="hidden" value="{{id}}">
					</div>
				</div>
			</div>
			<div class="col-sm-4">
				<div class="form-group">
					<label class="col-sm-4 control-label" for="lessonTime">上课时间</label>
					<div class="col-sm-8">
						<div class="input-group">
							<span class="input-group-btn">
								<select name="times[0].week" id="lessonWeek" class="chosen-select">
									<option value="周一">周一</option>
									<option value="周二">周二</option>
									<option value="周三">周三</option>
									<option value="周四">周四</option>
									<option value="周五">周五</option>
									<option value="周六">周六</option>
									<option value="周日">周日</option>
								</select>
							</span>
							<input name="times[0].time" id="lessonTime" type="text" class="form-control time-selector" {{times '#lessonWeek' '#lessonTime' '#timeid'}}> 
						</div>
						<input name="times[0].id" type="hidden" id="timeid">
						<input name="times[0].classesId" type="hidden" value="{{id}}">
					</div>
				</div>
			</div>
			<div class="col-sm-4">
				<div class="form-group">
					<label class="col-sm-4 control-label" for="room">教室选择</label>
					<div class="col-sm-8">
						<select name="relations[1].targetid" id="room" class="chosen-select"
							data-entity="com.app.miwawa.api.eam.entity.Room">
							{{room room '#room'}}
						</select>
						<input name="relations[1].target" type="hidden" value="room">
						<input name="relations[1].status" type="hidden" value="0">
						<input name="relations[1].invalid" type="hidden" value="F">
						<input name="relations[1].classesid" type="hidden" value="{{id}}">
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-sm-4">
				<div class="form-group">
					<label class="col-sm-4 control-label" for="createDate">开班时间</label>
					<div class="col-sm-8">
						<div class="input-group date date-selector">
							<input name="createDate" id="createDate" type="text" class="form-control" value="{{createDate}}"> 
							<span class="input-group-addon">
								<span class="fa fa-calendar"></span>
							</span>
						</div>
					</div>
				</div>
			</div>
			<div class="col-sm-4">
				<div class="form-group">
					<label class="col-sm-4 control-label required" for="toplimit">学员上限</label>
					<div class="col-sm-8">
						<div class="input-group">
							<input name="toplimit" id="toplimit" type="text" class="form-control" required="required" value="{{toplimit}}"/>
							<span class="input-group-addon">人</span>
						</div>
					</div>
				</div>
			</div>
			<div class="col-sm-4">
				<div class="form-group">
					<label class="col-sm-4 control-label required" for="trylimit">试听上限</label>
					<div class="col-sm-8">
						<div class="input-group">
							<input name="trylimit" id="trylimit" type="text" class="form-control" required="required" value="{{trylimit}}"/>
							<span class="input-group-addon">人</span>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-sm-8">
				<div class="form-group">
					<label class="col-sm-2 control-label required" for="name">班级名称</label>
					<div class="col-sm-10">
						<div class="input-group">
							<input name="type" type="hidden" value="{{type}}">
							<input name="name" id="name" type="text" class="form-control" required="required" value="{{name}}" readonly="readonly"/>
							<span class="input-group-btn">
								<button type="button" class="btn btn-addon" data-toggle="tooltip" data-placement="top" title="生成名称" onclick="createName()">
									<i class="fa fa-refresh"></i>
								</button>
							</span>
						</div>
					</div>
				</div>
			</div>
			<div class="col-sm-4">
				<div class="form-group">
					<label class="col-sm-4 control-label required" for="usecount">耗课数</label>
					<div class="col-sm-8">
						<input name="usecount" id="usecount" type="text" class="form-control" value="{{usecount}}" required="required"/>
					</div>
				</div>
			</div>
		</div>
		
		<div class="widget-footer editor-footer-sm">
			<button type="button" class="btn btn-danger btn-sm" data-toggle="tooltip" data-placement="top" title="取消" onclick="handlerCancel(this);" data-refresh-table="#table-classes">
				<i class="glyphicon glyphicon-remove"></i>
			</button>
			<button type="button" class="btn btn-primary btn-sm" data-toggle="tooltip" data-placement="top" title="保存" onclick="handlerSubmit(this, '#editor-form-classes', '.form-editor-classes', 'createName');">
				<i class="glyphicon glyphicon-ok"></i>
			</button>
		</div>
	</form>
</script>

<!-- TODO 查看与编辑 班级信息 托班-->
<script id="edit-classes-template-dc" type="text/x-handlebars-template">
	<form class="form-horizontal form-editor form-editor-classes">
		<input type="hidden" name="id" value="{{id}}">
		<div class="row">
			<div class="col-sm-4">
				<div class="form-group">
					<label class="col-sm-4 control-label" for="type">托班类型</label>
					<div class="col-sm-8">
						<div class="input-group">
							<label class="radio-inline c-radio"> 
								<input type="radio" name="times[0].type" class="select-type" value="全托"/> 
								<span class="fa fa-check"></span> 全托
							</label> 
							<label class="radio-inline c-radio"> 
								<input type="radio" name="times[0].type" class="select-type" value="半托"/> 
								<span class="fa fa-check"></span> 半托
							</label>
						</div>
						<input type="hidden" name="times[1].type"/> 
					</div>
				</div>
			</div>
			<div class="col-sm-4">
				<div class="form-group">
					<label class="col-sm-4 control-label" for="createDate">开班时间</label>
					<div class="col-sm-8">
						<div class="input-group date date-selector">
							<input name="createDate" id="createDate" type="text" class="form-control" value="{{createDate}}"> 
							<span class="input-group-addon">
								<span class="fa fa-calendar"></span>
							</span>
						</div>
					</div>
				</div>
			</div>
			<div class="col-sm-4">
				<div class="form-group">
					<label class="col-sm-4 control-label" for="room">教室选择</label>
					<div class="col-sm-8">
						<select name="relations[0].targetid" id="room" class="chosen-select"
							data-entity="com.app.miwawa.api.eam.entity.Room">
							{{select room '#room'}}
						</select>
						<input name="relations[0].target" type="hidden" value="room">
						<input name="relations[0].status" type="hidden" value="0">
						<input name="relations[0].invalid" type="hidden" value="F">
						<input name="relations[0].classesid" type="hidden" value="{{id}}">
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-sm-4">
				<div class="form-group">
					<label class="col-sm-4 control-label required" for="name">班级名称</label>
					<div class="col-sm-8">
						<input name="name" id="name" type="text" class="form-control" required="required" value="{{name}}"/>
						<input name="type" type="hidden">
					</div>
				</div>
			</div>
			<div class="col-sm-4">
				<div class="form-group">
					<label class="col-sm-4 control-label required" for="toplimit">学员上限</label>
					<div class="col-sm-8">
						<div class="input-group">
							<input name="toplimit" id="toplimit" type="text" class="form-control" required="required" value="{{toplimit}}"/>
							<span class="input-group-addon">人</span>
						</div>
					</div>
				</div>
			</div>
			<div class="col-sm-4">
				<div class="form-group">
					<label class="col-sm-4 control-label required" for="trylimit">试听上限</label>
					<div class="col-sm-8">
						<div class="input-group">
							<input name="trylimit" id="trylimit" type="text" class="form-control" required="required" value="{{trylimit}}"/>
							<span class="input-group-addon">人</span>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-sm-4">
				<div class="form-group">
					<label class="col-sm-4 control-label" for="fromWeek">上课周期</label>
					<div class="col-sm-8">
						<div class="input-group">
							<span class="input-group-btn">
								<select name="times[0].week" id="fromWeek" class="chosen-select">
									<option value="周一">周一</option>
									<option value="周二">周二</option>
									<option value="周三">周三</option>
									<option value="周四">周四</option>
									<option value="周五">周五</option>
									<option value="周六">周六</option>
									<option value="周日">周日</option>
								</select>
							</span>
							<span class="input-group-addon">-</span>
							<span class="input-group-btn">
								<select name="times[1].week" id="overWeek" class="chosen-select">
									<option value="周一">周一</option>
									<option value="周二">周二</option>
									<option value="周三">周三</option>
									<option value="周四">周四</option>
									<option value="周五">周五</option>
									<option value="周六">周六</option>
									<option value="周日">周日</option>
								</select>
							</span>
						</div>
					</div>
				</div>
			</div>
			<div class="col-sm-4">
				<div class="form-group">
					<label class="col-sm-4 control-label" for="fromTime">上课时间</label>
					<div class="col-sm-8">
						<div class="input-group">
							<input name="times[0].time" id="fromTime" type="text" class="form-control time-selector" value="08:00">
							<span class="input-group-addon">-</span>
							<input name="times[1].time" id="overTime" type="text" class="form-control time-selector" value="16:00">
						</div>
						<input name="times[0].id" type="hidden" id="fromid">
						<input name="times[1].id" type="hidden" id="overid">
						<input name="times[0].mode" type="hidden" value="from">
						<input name="times[1].mode" type="hidden" value="over">
						<input name="times[0].status" type="hidden" value="0">
						<input name="times[1].status" type="hidden" value="0">
						<input name="times[0].invalid" type="hidden" value="F">
						<input name="times[1].invalid" type="hidden" value="F">
						<input name="times[0].classesId" type="hidden" value="{{id}}">
						<input name="times[1].classesId" type="hidden" value="{{id}}">
						{{times}}
					</div>
				</div>
			</div>
		</div>
		
		<div class="widget-footer editor-footer-sm">
			<button type="button" class="btn btn-danger btn-sm" data-toggle="tooltip" data-placement="top" title="取消" onclick="handlerCancel(this);" data-refresh-table="#table-classes">
				<i class="glyphicon glyphicon-remove"></i>
			</button>
			<button type="button" class="btn btn-primary btn-sm" data-toggle="tooltip" data-placement="top" title="保存" onclick="checkTime(this, '#editor-form-classes', '.form-editor-classes');">
				<i class="glyphicon glyphicon-ok"></i>
			</button>
		</div>
	</form>
</script>
	
<script id="view-classes-template-ee" type="text/x-handlebars-template">
	{{#each this}}
		<form class="form-horizontal form-editor form-editor-classes">
			<input type="hidden" name="id" value="{{id}}">
			<div class="row">
				<div class="col-sm-4">
					<div class="form-group">
						<label class="col-sm-4 control-label" for="lesson">课程选择</label>
						<div class="col-sm-8">
							<select name="relations[0].targetid" id="lesson" class="chosen-select"
								data-entity="com.app.miwawa.api.eam.entity.Lesson">
								{{select lesson '#lesson'}}
							</select>
							<input name="relations[0].target" type="hidden" value="lesson">
							<input name="relations[0].status" type="hidden" value="0">
							<input name="relations[0].invalid" type="hidden" value="F">
							<input name="relations[0].classesid" type="hidden" value="{{id}}">
						</div>
					</div>
				</div>
				<div class="col-sm-4">
					<div class="form-group">
						<label class="col-sm-4 control-label" for="lessonTime">上课时间</label>
						<div class="col-sm-8">
							<div class="input-group">
								<span class="input-group-btn">
									<select name="times[0].week" id="lessonWeek" class="chosen-select">
										<option value="周一">周一</option>
										<option value="周二">周二</option>
										<option value="周三">周三</option>
										<option value="周四">周四</option>
										<option value="周五">周五</option>
										<option value="周六">周六</option>
										<option value="周日">周日</option>
									</select>
								</span>
								<input name="times[0].time" id="lessonTime" type="text" class="form-control time-selector" {{times '#lessonWeek' '#lessonTime' '#timeid'}}> 
							</div>
							<input name="times[0].id" type="hidden" id="timeid">
							<input name="times[0].classesId" type="hidden" value="{{id}}">
						</div>
					</div>
				</div>
				<div class="col-sm-4">
					<div class="form-group">
						<label class="col-sm-4 control-label" for="room">教室选择</label>
						<div class="col-sm-8">
							<select name="relations[1].targetid" id="room" class="chosen-select"
								data-entity="com.app.miwawa.api.eam.entity.Room">
								{{select room '#room'}}
							</select>
							<input name="relations[1].target" type="hidden" value="room">
							<input name="relations[1].status" type="hidden" value="0">
							<input name="relations[1].invalid" type="hidden" value="F">
							<input name="relations[1].classesid" type="hidden" value="{{id}}">
						</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-4">
					<div class="form-group">
						<label class="col-sm-4 control-label" for="createDate">开班时间</label>
						<div class="col-sm-8">
							<div class="input-group date date-selector">
								<input name="createDate" id="createDate" type="text" class="form-control" value="{{createDate}}"> 
								<span class="input-group-addon">
									<span class="fa fa-calendar"></span>
								</span>
							</div>
						</div>
					</div>
				</div>
				<div class="col-sm-4">
					<div class="form-group">
						<label class="col-sm-4 control-label" for="toplimit">学员上限</label>
						<div class="col-sm-8">
							<div class="input-group">
								<input name="toplimit" id="toplimit" type="text" class="form-control" value="{{toplimit}}"/>
								<span class="input-group-addon">人</span>
							</div>
						</div>
					</div>
				</div>
				<div class="col-sm-4">
					<div class="form-group">
						<label class="col-sm-4 control-label" for="trylimit">试听上限</label>
						<div class="col-sm-8">
							<div class="input-group">
								<input name="trylimit" id="trylimit" type="text" class="form-control" value="{{trylimit}}"/>
								<span class="input-group-addon">人</span>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-8">
					<div class="form-group">
						<label class="col-sm-2 control-label required" for="name">班级名称</label>
						<div class="col-sm-10">
							<div class="input-group">
								<input name="type" type="hidden" value="{{type}}">
								<input name="name" id="name" type="text" class="form-control" required="required" value="{{name}}" readonly="readonly"/>
								<span class="input-group-btn">
									<button type="button" class="btn btn-addon" data-toggle="tooltip" data-placement="top" title="生成名称" onclick="createName()">
										<i class="fa fa-refresh"></i>
									</button>
								</span>
							</div>
						</div>
					</div>
				</div>
				<div class="col-sm-4">
					<div class="form-group">
						<label class="col-sm-4 control-label required" for="usecount">耗课数</label>
						<div class="col-sm-8">
							<input name="usecount" id="usecount" type="text" class="form-control" value="{{usecount}}" required="required"/>
						</div>
					</div>
				</div>
			</div>
			
			<div class="widget-footer editor-footer-sm">
				<button type="button" class="btn btn-danger btn-sm" data-toggle="tooltip" data-placement="top" title="取消" onclick="handlerCancel(this);" data-refresh-table="#table-classes">
					<i class="glyphicon glyphicon-remove"></i>
				</button>
				<button type="button" class="btn btn-primary btn-sm" data-toggle="tooltip" data-placement="top" title="保存" onclick="handlerSubmit(this, '#editor-form-classes', '.form-editor-classes', 'createName');">
					<i class="glyphicon glyphicon-ok"></i>
				</button>
			</div>
		</form>
	{{/each}}
</script>